'; // Indexing the articles is good, but not these monthly summaries if (is_numeric($day)) { $sql_txt = "select date_format(ts_created, '%Y/%m/%d'), name, date_format(ts_created, '%a, %e %b %Y') from blog_entries where date_format(ts_created, '%Y%m%d') > '$year$month$day' order by ts_created limit 1"; $result = mysql_query($sql_txt); if ($result && mysql_num_rows($result)) { $entry = mysql_fetch_row($result); $yymmdd = $entry[0]; $name = $entry[1]; $long_date = $entry[2]; $next_link = "See next newer entry: $name ($long_date)"; } else $next_link = ""; $sql_txt = "select date_format(ts_created, '%Y/%m/%d'), name, date_format(ts_created, '%a, %e %b %Y') from blog_entries where date_format(ts_created, '%Y%m%d') < '$year$month$day' order by ts_created desc limit 1"; $result = mysql_query($sql_txt); if ($result && mysql_num_rows($result)) { $entry = mysql_fetch_row($result); $yymmdd = $entry[0]; $name = $entry[1]; $long_date = $entry[2]; $prev_link = "See next older entry: $name ($long_date)"; } else $prev_link = ""; $sql_txt = "select entry_id from blog_entries where date_format(ts_created, '%Y%m%d') = '$year$month$day' order by ts_created desc"; } else { // // This is for the monthly display // $timestamp_for_displayed_month = strtotime("$year-$month-01"); $sql_txt = "select date_format(ts_created, '%Y/%m'), date_format(ts_created, '%M %Y') from blog_entries where date_format(ts_created, '%Y%m') > '$year$month' order by ts_created limit 1"; $result = mysql_query($sql_txt); if ($result && mysql_num_rows($result)) { $entry = mysql_fetch_row($result); $yymm = $entry[0]; $long_date = $entry[1]; $next_link = "See next newer month: $long_date"; } else $next_link = ""; $sql_txt = "select date_format(ts_created, '%Y/%m'), date_format(ts_created, '%M %Y') from blog_entries where date_format(ts_created, '%Y%m') < '$year$month' order by ts_created desc limit 1"; $result = mysql_query($sql_txt); if ($result && mysql_num_rows($result)) { $entry = mysql_fetch_row($result); $yymm = $entry[0]; $long_date = $entry[1]; $prev_link = "See next older month: $long_date"; } else $prev_link = ""; //$next_yymm = date("Y/m", $timestamp_for_displayed_month + 60*60*24*40); // 40 days from the first of this month should always be next month //$next_long_yymm = date("F Y", $timestamp_for_displayed_month + 60*60*24*40); // 40 days from the first of this month should always be next month //$next_link = "See next newer month: $next_long_yymm"; //$prev_yymm = date("Y/m", $timestamp_for_displayed_month - 60*60*24*20); // 20 days from the first of this month should always be next month //$prev_long_yymm = date("F Y", $timestamp_for_displayed_month - 60*60*24*20); // 20 days from the first of this month should always be next month //$prev_link = "See next older month: $prev_long_yymm"; $sql_txt = "select entry_id from blog_entries where date_format(ts_created, '%Y%m') = '$year$month' order by ts_created desc"; } $result = mysql_query($sql_txt); if($result) { if (mysql_num_rows($result)) { $num_rows = mysql_num_rows($result); for ($i = 0; $i < $num_rows; $i++) { $entry = mysql_fetch_row($result); $id = $entry[0]; print_blog_entry_with_comments($id); } } echo "
Read more
$next_link
$prev_link
"; } else { echo ""; } } else { header ("Location: " . $webvars["SERVER_ROOT"]); //wc_track_now(); // Let's log it. exit; } } print_footer(); //wc_track_now(); ?>